import Mock from 'mockjs'

Mock.mock(`${process.env.VUE_APP_API_BASE_URL}/routes`, 'get', () => {
  let result = {}
  result.code = 0
  if(localStorage.getItem('menuLevel')==1){
    result.data = [{
      router: 'root',
      children: [
        {
          router: 'dashboard',
          children: ['workplace'],
        },
        {
          router: 'form',
          children: ['basic', 'advance']
        },
      ]
    }]
  }else{
    result.data = [{
      router: 'root',
      children: [
        {
          router: 'dashboard',
          children: ['workplace'],
        },
        {
          router: 'list',
          children: ['query', 'multiHeader', 'editTable']
        },
      ]
    }]
  }
  return result
})
